﻿<?php

/**
 * @author phpadmin
 * @copyright 2010
 */

 class UserInfo{
    private $userName;
    private $userPWD;
    private $userReName;
    private $userEmail;
    private $userInfo;
    private $users;
    
    public function __construct($name){
        require_once("db_config.inc");
        $sql="select * from user";
        //$conn=mysql_connect($db_server,$db_user,$db_pwd);
        //$my_db=mysql_select_db($db_name,$conn);
        //mysql_query("SET NAMES 'utf8'");
        $result=mysql_query($sql,$conn);
        $this->userInfo=mysql_fetch_array($result);
        $this->getInfo();
        
        $this->users=mysql_num_rows($result);
    }
    
    private function getInfo(){
        $this->userName=$this->userInfo['username'];
        $this->userPWD=$this->userInfo['password'];
        $this->userReName=$this->userInfo['realname'];
        $this->userEmail=$this->userInfo['email'];
    }
    public function getNums(){
        return $this->users;
    }
    public function getUserName(){
        return $this->userName;
    }
    public function getUserPWD(){
        return $this->userPWD;
    }
    public function getUserReName(){
        return $this->userReName;
    }
    public function getUserEmail(){
        return $this->userEmail;
    }
 }

?>